package com.teame.readbaby;



import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.view.View;
import android.view.ViewGroup.LayoutParams;
import android.widget.ImageView;

public class SplashActivity extends Activity {

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		
		ImageView iv = new ImageView(this);
		iv.setImageResource(R.drawable.welcome);
		setContentView(iv);
		
		new Handler().postDelayed(new Runnable() {
			// 为了减少代码使用匿名Handler创建一个延时的调用
			public void run() {
				Intent i = new Intent(SplashActivity.this, HomeActivity.class);
				// 通过Intent打开最终真正的主界面Main这个Activity
				SplashActivity.this.startActivity(i); // 启动Main界面
				SplashActivity.this.finish(); // 关闭自己这个开场屏
			}
		}, 1500);
	}
	
}
